package cn.itcast.demo.config;

/**
 * @author 虎哥
 */
// @Configuration
public class PaymentConfig {

    // @Bean
    // @ConfigurationProperties(prefix = "pay.nopassword")
    public PaymentProperties paymentProperties(){
        // 创建PaymentProperties的对象
        return new PaymentProperties();
    }

    /**
     * 读取properties文件中的值
     */
    /*@Value("${pay.nopassword.maxAmountPerDeal}")
    private Long amountPerDeal;
    @Value("${pay.nopassword.maxAmountTotal}")
    private Long maxAmountTotal;

    @Bean
    public PaymentProperties paymentProperties(){
        // 创建PaymentProperties的对象
        PaymentProperties properties = new PaymentProperties();
        // 设置属性
        properties.setMaxAmountPerDeal(amountPerDeal);
        properties.setMaxAmountTotal(maxAmountTotal);
        // 返回
        return properties;
    }*/
}
